projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37de8f4
)
csv fix from Alex.
author
robertl
<robertl>
Thu, 26 Sep 2002 18:02:21 +0000
(18:02 +0000)
committer
robertl
<robertl>
Thu, 26 Sep 2002 18:02:21 +0000
(18:02 +0000)
csv_util.c
patch
|
blob
|
history
diff --git
a/csv_util.c
b/csv_util.c
index 8f27c5f2fc7a8805bb0c00ca62156a7c5d7436a7..207c74a144257071929bf061dca6748925dda678 100644
(file)
--- a/
csv_util.c
+++ b/
csv_util.c
@@
-107,8
+107,9
@@
csv_stringtrim(const char *string, const char *enclosure)
/* if we have enclosures, skip past them in pairs */
if (elen) {
- while ((strncmp(tmp, enclosure, elen) == 0)
- && (strncmp(p2, enclosure, elen) == 0)) {
+ while (((p2 - p1) > elen) &&
+ (strncmp(p1, enclosure, elen) == 0) &&
+ (strncmp((p2 - elen + 1), enclosure, elen) == 0)) {
p2 -= elen;
p1 += elen;
}